<?php $CI =& get_instance()?>
<h2 class="dialog_title"><span>Daftar Perbuatan</span></h2>
<div class="dialog_content" style="padding: 10px 20px; width:700px">
<?php $CI->load->model('karyawan_model')?>
<?php $res = $CI->karyawan_model->select_by_id($kary_id)?>
<?php $res = (array)$res->row()?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
	<tr>
	  <td>Karyawan : </td>
	  <td><strong><?php echo $res['kary_nama'] ?></strong></td>
    </tr>
	<tr>
		<td width="80">Periode : </td>
		<td><strong><?php echo $month ?> - <?php echo $year ?></strong></td>
	</tr>
</table>
<?php $z=0;?>
<table class="zebraable" width="100%" border="0" cellpadding="5" cellspacing="0">
  <tr class="header">
  	<td align="left"><span class="colorWhite">No</span></td>
  	<td align="left"><span class="colorWhite">Tgl Pengesahan</span></td>
    <td align="left"><span class="colorWhite">Jenis</span></td>
    <td align="left"><span class="colorWhite">Bidang</span></td>
    <td align="left"><span class="colorWhite">Tingkat</span></td>
    <td align="left"><span class="colorWhite">Kategori</span></td>
    <td align="right"><span class="colorWhite">Perbuatan Ke</span></td>
    <td align="right"><span class="colorWhite">Point</span></td>  
  </tr>
  <tbody id="searchKary-table" style="overflow:scroll; height:200px" >
<?php
	$sql = "SELECT * FROM penilaian
			JOIN prestasi_pelanggaran_detil ON prestasi_pelanggaran_detil.detachiev_id = penilaian.detachiev_id
			JOIN prestasi_pelanggaran ON prestasi_pelanggaran.achiev_id= prestasi_pelanggaran_detil.achiev_id
			WHERE penilaian.kary_id = '$kary_id' 
				AND DATE_FORMAT(penilaian.point_tgl_aktif,'%Y-%m')='$year-$month'";
	$result = $CI->karyawan_model->query($sql);
	$pointCount = 0;
?>
<?php foreach ($result->result_array() as $row): ?>
<?php $pointCount += $row['point_point'];?>
  <tr  <?php if($z++%2==0):?>class="zebra"<?php endif?>>
  	<td><?php echo $z?></td>
  	<td><?php echo $row['point_tgl_aktif']?></td>
  	<td><?php echo $jenis_options[$row['achiev_jenis']]?></td>
    <td><?php echo $row['achiev_bidang']?></td>
    <td><?php echo $tingkat_options[$row['detachiev_tingkat']]?></td>
    <td><?php echo $row['detachiev_nama']?></td>
    <td align="right"><?php echo $row['point_count']?></td>
    <td align="right"><?php echo $row['point_point']?></td>
  </tr>
<?php endforeach?>
  </tbody>
  <tr class="header">
    <th align="right" colspan="7"><span class="colorWhite">Jumlah Point : </span></th>
    <th align="right"><span class="colorWhite"><?php echo number_format($pointCount,2) ?></span></th>  
  </tr>
</table>
</div>
<div class="dialog_buttons"><input type="button" value="Close" name="close" onclick="FBModal_hide()" /></div>